package com.example.demo.huawei;

import java.util.*;

//寻找连续区间/数组连续和 动态规划
// 给定一个含有N个数的数组
public class OD51_2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int x = scanner.nextInt();
        int[] arr = new int[n];

        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }

        System.out.println(x);
        System.out.println(Arrays.toString(arr));
        Set<List<Integer>> sets = new HashSet<>();
        // 暴力枚举出所有的子区间，存储在set中去重，最后求出每个字区间的和 记录满足要求的结果
        for (int i = 0; i < arr.length; i++) {
            for (int j = 1; j < arr.length; j++) {
                List<Integer> list = new ArrayList<>();
                for (int k = i; k <= j; k++) {
                    list.add(arr[k]);
                }
                sets.add(list);
            }
        }
        int count = 0;
        for (List<Integer> list : sets) {
            int sum = 0;
            for (Integer i : list) {
                sum += i;
            }
            if (sum >= x) {
                count++;
            }
        }
        System.out.println(count);
    }
}
